home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 1.0 for Developers / QuickTime 1.0 for Developers.iso / Programming Stuff / Interfaces / Oldstyle C Interfaces / image compression.h < prev    next >
C/C++ Source or Header  |  1991-09-06  |  41KB  |  1,468 lines

  1. /*
  2.     File:        Image Compression.h
  3.     Contains:    Image Compression Manager definitions
  4.     Copyright:    © 1991 by Apple Computer, Inc., all rights reserved.
  5. */
  6.  
  7. #ifndef    __CODEC__
  8.  
  9. #define    __CODEC__
  10.  
  11. #include    <QuickDraw.h>
  12. #include    <QDOffscreen.h>
  13. #include    <Types.h>
  14.  
  15. #if THINK_C == 1
  16.     #define    PASCAL                /* for some reason Think C doesn't like pascal type for ProcPtrs */
  17. #else
  18.     #define    PASCAL    pascal
  19. #endif
  20.  
  21.  
  22. #include    "Components.h"
  23. #include    "Matrix.h"
  24.  
  25.  
  26. #ifdef    CODEC_MGR_VERSION
  27. #if    CODEC_MGR_VERSION    != 15
  28.     WRONG CODEC_MGR_VERSION
  29. #endif
  30. #endif
  31.  
  32. #define gestaltCompressionMgr 'icmp'
  33.  
  34.     /*
  35.     
  36.         These are the bits that are set in the Component flags, and also in the codecInfo struct.
  37.         
  38.     */
  39.  
  40.  
  41.  
  42.  
  43. #define    codecInfoDoes1                (1L<<0)        /* codec can work with 1-bit pixels */
  44. #define    codecInfoDoes2                (1L<<1)        /* codec can work with 2-bit pixels */
  45. #define    codecInfoDoes4                (1L<<2)        /* codec can work with 4-bit pixels */
  46. #define    codecInfoDoes8                (1L<<3)        /* codec can work with 8-bit pixels */
  47. #define    codecInfoDoes16                (1L<<4)        /* codec can work with 16-bit pixels */
  48. #define    codecInfoDoes32                (1L<<5)        /* codec can work with 32-bit pixels */
  49. #define    codecInfoDoesDither            (1L<<6)        /* codec can do ditherMode */
  50. #define    codecInfoDoesStretch        (1L<<7)        /* codec can stretch to arbitrary sizes */
  51. #define    codecInfoDoesShrink            (1L<<8)        /* codec can shrink to arbitrary sizes */
  52. #define    codecInfoDoesMask            (1L<<9)        /* codec can mask to clipping regions */
  53.     
  54. #define    codecInfoDoesTemporal        (1L<<10)    /* codec can handle temporal redundancy */
  55.  
  56. #define    codecInfoDoesDouble            (1L<<11)    /* codec can stretch to double size exactly */
  57. #define    codecInfoDoesQuad            (1L<<12)    /* codec can stretch to quadruple size exactly */
  58. #define    codecInfoDoesHalf            (1L<<13)    /* codec can shrink to half size */
  59. #define    codecInfoDoesQuarter        (1L<<14)    /* codec can shrink to quarter size */
  60.  
  61. #define    codecInfoDoesRotate            (1L<<15)    /* codec can rotate on decompress */
  62. #define    codecInfoDoesHorizFlip        (1L<<16)    /* codec can flip horizontally on decompress */
  63. #define    codecInfoDoesVertFlip        (1L<<17)    /* codec can flip vertically on decompress */
  64. #define    codecInfoDoesSkew            (1L<<18)    /* codec can skew on decompress */
  65. #define    codecInfoDoesBlend            (1L<<19)    /* codec can blend on decompress */
  66. #define    codecInfoDoesWarp            (1L<<20)    /* codec can warp arbitrarily on decompress */
  67. #define    codecInfoDoesRecompress        (1L<<21)    /* codec can recompress image
  68.                                                                 without accumulating errors */
  69.  
  70. #define    codecInfoDepth1                (1L<<0)        /* compressed data at 1 bpp depth available */
  71. #define    codecInfoDepth2                (1L<<1)        /* compressed data at 2 bpp depth available */
  72. #define    codecInfoDepth4                (1L<<2)        /* compressed data at 4 bpp depth available */
  73. #define    codecInfoDepth8                (1L<<3)        /* compressed data at 8 bpp depth available */
  74. #define    codecInfoDepth16            (1L<<4)        /* compressed data at 16 bpp depth available */
  75. #define    codecInfoDepth32            (1L<<5)        /* compressed data at 32 bpp depth available */
  76. #define    codecInfoDepth24            (1L<<6)        /* compressed data at 24 bpp depth available */
  77. #define    codecInfoDepth33            (1L<<7)        /* compressed data at 1 bpp monochrome depth  available */
  78. #define    codecInfoDepth34            (1L<<8)        /* compressed data at 2 bpp grayscale depth available */
  79. #define    codecInfoDepth36            (1L<<9)        /* compressed data at 4 bpp grayscale depth available */
  80. #define    codecInfoDepth40            (1L<<10)    /* compressed data at 8 bpp grayscale depth available */
  81. #define    codecInfoStoresClut            (1L<<11)    /* compressed data can have custom cluts */
  82.  
  83.  
  84.  
  85. #define    codecFlagUseImageBuffer        (1L<<0)        /* (input) allocate buffer for whole image on decompress sequence */
  86. #define    codecFlagUseScreenBuffer    (1L<<1)        /* (input) allocate buffer for screen on decompress sequence for faster updates */
  87. #define    codecFlagUpdatePrevious        (1L<<2)        /* (input) udate previous buffer on compress sequence */
  88. #define    codecFlagNoScreenUpdate        (1L<<3)        /* (input) dont update screen, but do update image buffer if allocated */
  89. #define    codecFlagWasCompressed        (1L<<4)        /* (input) hint to compressor that image was previously compressed */
  90. #define    codecFlagDontOffscreen        (1L<<5)        /* return error instead of automatically going offscreen */
  91. #define    codecFlagUpdatePreviousComp    (1L<<6)        /* (input) udate previous buffer on compress sequence */
  92. #define    codecFlagForceKeyFrame        (1L<<7)        /* when sent to CompressSequenceFrame, forces that frame to be a key frame */
  93. #define    codecFlagOnlyScreenUpdate    (1L<<8)        /* (input) only update screen from */
  94. #define    codecFlagLiveGrab            (1L<<9)        /* (input) data being compressed is from live source (speed is critical) */
  95.  
  96.  
  97.  
  98. #define    codecFlagUsedNewImageBuffer    (1L<<14)    /* (output) indicates that image buffer was first used on this decompress sequence */
  99. #define    codecFlagUsedImageBuffer    (1L<<15)    /* (output) indicates that image buffer was used on this decompress sequence */
  100.  
  101. #define    codecErr                    -8960        /* the codec returned an error */
  102. #define    noCodecErr                    -8961        /* the specified codec could not be found */
  103. #define    codecUnimpErr                -8962        /* this feature is not implemented by the specified codec */
  104. #define    codecSizeErr                -8963        
  105. #define    codecScreenBufErr            -8964        /* the screen buffer could not be allocated */
  106. #define    codecImageBufErr            -8965        /* the image buffer could not be allocated */
  107. #define    codecSpoolErr                -8966        /* the compressed data must be in memory (spooling did not work) */
  108. #define    codecAbortErr                -8967        /* the operation was aborted by the progress proc */
  109. #define    codecWouldOffscreenErr        -8968        /* an offscreen access would have been used, but wasn't allowed because codecFlagDontOffscreen was set */ 
  110. #define    codecBadDataErr                -8969        /* compressed data was found to have inconsistencies */
  111. #define    codecDataVersErr            -8970        /* compressed data was of a format version that codec couldn't handle */
  112. #define    codecExtensionNotFoundErr    -8971        /* requested image description extension could not be found */
  113.  
  114. #define    codecMinimumBufferSize        16384        /* The minimum data size for spooling in or out data */
  115.  
  116.  
  117. #define    compressorComponentType            'imco'        /* the type for "Components" which compress images */
  118. #define    decompressorComponentType        'imdc'        /* the type for "Components" which decompress images */
  119.  
  120.  
  121.  
  122. typedef    Component        CompressorComponent;        /* a Component which compresses images */
  123. typedef    Component        DecompressorComponent;        /* a Component which decompresses images */
  124. typedef    Component        CodecComponent;                /* a Component which decompresses or compresses images */
  125.  
  126.  
  127.  
  128. #define    anyCodec                ((CodecComponent)0)        /* take first working codec of given type */
  129. #define    bestSpeedCodec            ((CodecComponent)-1)    /* take fastest codec of given type */
  130. #define    bestFidelityCodec        ((CodecComponent)-2)    /* take codec which is most accurate*/
  131. #define    bestCompressionCodec    ((CodecComponent)-3)    /* take codec of given type that is most accurate */
  132.  
  133.  
  134.  
  135. typedef    short        sBoolean;        /* to make sure stack frames are right */
  136.  
  137. typedef    long        CodecType;        /* type descriptor for codecs i.e: 'appl','jpeg','rle ' */
  138.  
  139.  
  140. typedef    unsigned short    CodecFlags;    /* flags for codec manager calls */
  141.  
  142.  
  143. typedef    unsigned long    CodecQ;    /*       The quality is defined as a  number between codecMinQuality
  144.                                     and codecMaxQuality with codecLowQuality being low quality and
  145.                                     codecHighQuality being high quality - intermediate values may
  146.                                     or may not be implemented by a particular codec, and the
  147.                                     closest integral level will be used - the actual value used
  148.                                     should be returned by the GetMaxSize Function.
  149.  
  150.                                        The extremes of the range below codecLowQuality and above
  151.                                     codecHighQuality may give uneven results, but should be as
  152.                                     linear as possible numbers above codecMaxQuality are reserved
  153.                                     for each type of codec.
  154.                                 */
  155.                                    
  156.  
  157. #define    codecLosslessQuality        0x400L
  158. #define    codecMaxQuality                0x3ffL
  159. #define    codecMinQuality                0x000L
  160. #define    codecLowQuality                0x100L
  161. #define    codecNormalQuality            0x200L
  162. #define    codecHighQuality            0x300L
  163.  
  164.  
  165.  
  166. typedef PASCAL OSErr (*DataProcPtr)(Ptr *dataP,long bytesNeeded,long refcon);        
  167.                                 /*     The DataProc is called by CoDecs when they need to get more
  168.                                     data than is in the buffer passed to them. They are called
  169.                                     with the original pointer and the number of bytes needed,
  170.                                     which will not exceed the number of bytes originally in the
  171.                                     buffer. If the data can not be returned an error code should
  172.                                     be returned. 
  173.                                     
  174.                                        If data is nil then the data buffer should be rewound to the
  175.                                     beginning of the datastream + bytesNeeded. Subsequent calls
  176.                                     should return data beginning from this location. If this can't
  177.                                     be done, then the dataProc should return an non-zero result.
  178.                                 */
  179.  
  180.  
  181.  
  182. typedef PASCAL OSErr (*FlushProcPtr)(Ptr data,long bytesAdded,long refcon);
  183.                                 /*        The FlushProc is called by CoDecs when they need to create
  184.                                     more data than fits in the buffer passed to them. They are
  185.                                     called with the original pointer and the number of bytes added
  186.                                     so far, which will not exceed the number of bytes originally
  187.                                     in the buffer. If all the data can not be obtained an non-zero
  188.                                     error should be returned. 
  189.                                     
  190.                                        If data is nil then the data buffer should be rewound to
  191.                                     the beginning of the datastream + bytes added.Subsequent calls
  192.                                     should put overwrite the data beginning at this location. If
  193.                                     this can't be done, then the flushProc should return an
  194.                                     non-zero result.
  195.                                 */
  196.  
  197. typedef PASCAL void (*CompletionProcPtr)(OSErr result,short flags,long refcon);
  198.                                 /*       The CompletionProc is called when an asynchronous call is
  199.                                     completed. The result is the on ly argument, but any
  200.                                     parameters set by the async call (including the resulting
  201.                                     data) are not valid until the CompletionProc is called.
  202.                                 */
  203. #define    codecCompletionSource        (1<<0)
  204. #define    codecCompletionDest            (1<<1)
  205.  
  206.  
  207. typedef PASCAL OSErr (*ProgressProcPtr)(short message,Fixed completeness,long refcon);
  208.                                 /*    The ProgressProcPtr is called during compression or
  209.                                     decompression with a number that indicates the percent
  210.                                     complete (0-1.0). It also indicates abortion requests if
  211.                                     the result is not noErr.
  212.                                 */
  213.  
  214.  
  215. #define    codecProgressOpen            0
  216. #define    codecProgressUpdatePercent    1
  217. #define    codecProgressClose            2
  218.  
  219.  
  220.  
  221.  
  222. /*
  223.  
  224.     StdPix bottleneck procedure. This is the CGrafProc newProc1 whenever the ICM is installed.
  225.     
  226.     
  227.     To pass in a compressed image it should be packed into a PixMap struct using 
  228.     SetCompressedPixMapInfo. When intercepting it, you can determine if  the PixMap
  229.     contains a compressed image by calling GetCompressedPixMapInfo.
  230. */
  231.  
  232.  
  233.  
  234. typedef PASCAL void (*StdPixProcPtr)(PixMap *src,Rect *srcRect,MatrixRecord *matrix,short mode,
  235.     RgnHandle mask,PixMap *matte,Rect *matteRect,short flags);
  236.  
  237.  
  238. typedef    long ImageSequence;
  239.  
  240.  
  241.  
  242.  
  243.  
  244. typedef    struct {
  245.     ProgressProcPtr    progressProc;
  246.     long            progressRefCon;
  247. } ProgressProcRecord;
  248.  
  249. typedef    ProgressProcRecord    *ProgressProcRecordPtr;
  250.  
  251. typedef    struct {
  252.     CompletionProcPtr    completionProc;
  253.     long                completionRefCon;
  254. } CompletionProcRecord;
  255.  
  256. typedef    CompletionProcRecord    *CompletionProcRecordPtr;
  257.  
  258. typedef    struct {
  259.     DataProcPtr        dataProc;
  260.     long            dataRefCon;
  261. } DataProcRecord;
  262.  
  263.  
  264. typedef    DataProcRecord    *DataProcRecordPtr;
  265.  
  266.  
  267. typedef    struct {
  268.     FlushProcPtr    flushProc;
  269.     long            flushRefCon;
  270. } FlushProcRecord;
  271.  
  272. typedef    FlushProcRecord    *FlushProcRecordPtr;
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281. /* 
  282.     The ImageDescription is private data which is produced when an image or sequence 
  283.     is compressed. It fully describes the format of the compressed data.
  284. */
  285.  
  286. typedef struct ImageDescription {
  287.     long        size;                /* total size of ImageDescription including extra data ( CLUTs and other per sequence data */
  288.     CodecType    cType;                /* what kind of codec compressed this data */
  289.     long        resvd1;                /* reserved for apple use */
  290.     long        resvd2;                /* reserved for apple use */
  291.     short        version;            /* which version is this data */
  292.     short        revisionLevel;        /* what version of that codec did this */
  293.     long        vendor;                /* whose  codec compressed this data */
  294.     CodecQ        temporalQuality;    /* what was the temporal quality factor */
  295.     CodecQ        spatialQuality;        /* what was the spatial quality factor */            
  296.     short        width;                /* how many pixels wide is this data */
  297.     short        height;                /* how many pixels high is this data */
  298.     Fixed        hRes;                /* horizontal resolution */
  299.     Fixed        vRes;                /* vertical resolution */
  300.     long        dataSize;            /* if known, the size of data for this image descriptor */
  301.     short        frameCount;            /* number of frames this description applies to */
  302.     char        name[32];            /* name of codec ( in case not installed ) */
  303.     short        depth;                /* what depth is this data (1-32) or ( 33-40 grayscale ) */
  304.     short        clutID;                /* clut id or if 0 clut follows  or -1 if no clut */
  305. } ImageDescription;
  306.  
  307.  
  308. typedef    ImageDescription    *ImageDescriptionPtr;
  309.  
  310. typedef    ImageDescription    **ImageDescriptionHandle;
  311.  
  312.  
  313. /* 
  314.     The CodecInfo is the information returned as the codecInfo struct by a codec Component
  315.     to the codec manager or to the caller. It is specific to the particular codec
  316.     implementation and not to the codec type.
  317. */
  318.  
  319. typedef struct CodecInfo {
  320.     char             typeName[32];                    /* name of the codec type i.e.: 'Apple Image Compression' */
  321.     short            version;                        /* version of the codec data that this codec knows about */
  322.     short            revisionLevel;                    /* revision level of this codec i.e: 0x00010001 (1.0.1) */
  323.     long            vendor;                            /* Maker of this codec i.e: 'appl' */
  324.     long             decompressFlags;                /* codecInfo flags for decompression capabilities */
  325.     long             compressFlags;                    /* codecInfo flags for compression capabilities */
  326.     long             formatFlags;                    /* codecInfo flags for compression format details */
  327.     unsigned char    compressionAccuracy;            /* measure (1-255) of accuracy of this codec for compress (0 if unknown) */
  328.     unsigned char    decompressionAccuracy;            /* measure (1-255) of accuracy of this codec for decompress (0 if unknown) */
  329.     unsigned short    compressionSpeed;                /* ( millisecs for compressing 320x240 on base mac II) (0 if unknown) */
  330.     unsigned short    decompressionSpeed;                /* ( millisecs for decompressing 320x240 on mac II)(0 if unknown) */
  331.     unsigned char    compressionLevel;                /* measure (1-255) of compression level of this codec (0 if unknown) */
  332.     char            resvd;                            /* pad */
  333.     short            minimumHeight;                    /* minimum height of image (block size) */
  334.     short            minimumWidth;                    /* minimum width of image (block size) */
  335.     short            decompressPipelineLatency;        /* in milliseconds ( for asynchronous codecs ) */
  336.     short            compressPipelineLatency;        /* in milliseconds ( for asynchronous codecs ) */
  337.     long            privateData;
  338. } CodecInfo;
  339.  
  340.  
  341.  
  342.  
  343.  
  344.  
  345. /*
  346.     Table used for fast dithering.
  347. */
  348.  
  349. typedef    struct {
  350.     long    tag;
  351.     long    seed;
  352.     long    reserved;
  353.     char    data[1];
  354. } DitherTable;
  355.  
  356. typedef    DitherTable    *DTabPtr;
  357.  
  358. typedef    DitherTable    **DTabHandle;
  359.  
  360. typedef    DTabHandle    *DTabHPtr;
  361.  
  362.  
  363.  
  364. /*
  365.     Name list returned by GetCodecNameList.
  366. */
  367.  
  368.  
  369. typedef    struct {
  370.     CodecComponent        codec;
  371.     CodecType        cType;
  372.     char            typeName[32];
  373.     Handle            name;
  374. } CodecNameSpec;
  375.  
  376. typedef    struct {
  377.     short            count;
  378.     CodecNameSpec    list[1];
  379. }CodecNameSpecList;
  380.  
  381.  
  382. typedef    CodecNameSpecList *CodecNameSpecListPtr;
  383.  
  384.  
  385. /*************************
  386.  
  387.     CodecTrapVersion
  388.     
  389.     This call returns the version of the codec manager installed.
  390.     
  391.     Return values:
  392.                         noErr
  393.                         paramErr
  394.  
  395. */
  396.  
  397.  
  398. pascal    OSErr
  399. CodecManagerVersion(long *version)
  400.     = {0x7000+0x0000,0xAAA3}
  401. ;
  402.  
  403.  
  404.  
  405.  
  406.  
  407. /*************************
  408.  
  409.     GetCodecNameList
  410.     
  411.     This call returns a list of all the codecs installed at the time it is called. If showAll is
  412.     true then all the codecs of each type are returned, otherwise only the the typename is
  413.     returned once for each type of codec.This is useful for selecting codec parameters. Pass in a 
  414.     pointer to an empty CodecNameSpecListPtr and the pointer will be allocated with the names
  415.     filled in. You can dispose this when you're done with DisposPtr.
  416.     
  417.     Return values:
  418.                         noErr
  419.                         paramErr
  420.  
  421. */
  422.  
  423.  
  424.  
  425. pascal OSErr
  426. GetCodecNameList(CodecNameSpecListPtr *list,sBoolean showAll)
  427.     = {0x7000+0x0001,0xAAA3}
  428. ;
  429.  
  430.  
  431.  
  432. /*************************
  433.  
  434.     GetCodecInfo
  435.     
  436.     This routine returns information for the codec with the given type. The first codec of 
  437.     the given type is used unless codec specifies a particular codec. 
  438.     
  439.     Return values:
  440.                         noErr
  441.                         codecErr
  442.                         noCodecErr
  443.                         paramErr
  444.  
  445. */
  446.  
  447. pascal    OSErr
  448. GetCodecInfo(CodecInfo *info,CodecType cType,CodecComponent codec)
  449.     = {0x7000+0x0003,0xAAA3}
  450. ;
  451.  
  452.  
  453.  
  454.  
  455.  
  456. /*************************
  457.  
  458.  
  459.     GetMaxCompressionSize
  460.     
  461.     This routine returns the maximum possible size in bytes that the compressed data will
  462.     be for the given parameters.
  463.     
  464.     Return values:
  465.                         noErr
  466.                         codecErr
  467.                         noCodecErr
  468.                         paramErr
  469.  
  470. */
  471.  
  472.  
  473. pascal OSErr
  474. GetMaxCompressionSize(PixMapHandle src,Rect *srcRect, short colorDepth,CodecQ quality,
  475.         CodecType cType,CompressorComponent codec,long *size)
  476.     = {0x7000+0x0004,0xAAA3}
  477. ;
  478.  
  479.  
  480. /*************************
  481.  
  482.  
  483.     GetCompressionTime
  484.     
  485.        The approximate compression time in milliseconds is returned for an image
  486.     with the given parameters. 
  487.        Quality should be set to the desired spatial and temporal quality, in it
  488.     will be returned the closest actual quality that the codec can achieve from
  489.     the requested one.If the time is zero it should be considered indeterminate.
  490.     
  491.     Return values:
  492.                         noErr
  493.                         codecErr
  494.                         noCodecErr
  495.                         paramErr
  496.  
  497. */
  498.  
  499.  
  500. pascal OSErr
  501. GetCompressionTime(PixMapHandle src,Rect *srcRect, short colorDepth,
  502.         CodecType cType,CompressorComponent codec,
  503.         CodecQ *spatialQuality,CodecQ *temporalQuality,unsigned long *compressTime)
  504.     = {0x7000+0x0005,0xAAA3}
  505. ;
  506.  
  507.  
  508.  
  509. /*************************
  510.  
  511.     CompressImage
  512.  
  513.     This routine compresses a single image ( from a pixmap) with the given parameters.
  514.     Type specifies which compression format you want the data to be returned in.
  515.     Quality determines the quality of the compressed image (See description of CodecQ above).
  516.  
  517.     ColorDepth tells the codec the pixel depth at which this image will most likely be viewed. 
  518.     Some codecs will use this to determine the color resolution of the compressed image. You
  519.     can determine which depths are supported by GetCodecInfo or GetCodecDepthList. If colorDepth is
  520.     zero the best matching depth available for the compressor is used. If the depth you specify
  521.     is not available the closest possible depth that the compressor can do is used.
  522.  
  523.     The compressed data is placed in dataPtr. 
  524.  
  525.     The actual number of bytes resulting is placed in the dataSize field of the image description
  526.     when the call is completed successfully. 
  527.     
  528.     The ImageDescription should be passed as an empty handle, and the handle will
  529.     sized and filled with additional data for this image which should be kept with the
  530.     compressed data.
  531.     
  532.     Codec could be a specific codec or one of the special
  533.     codec selectors (anyCodec,bestSpeedCodec, etc ).
  534.     
  535.     The color table is optional, and nil should be passed if it is not needed.
  536.     
  537.     the optional Progress proc is called as the operation progresses, and may abort it.
  538.     
  539.     The compressed data is written into the given pointer, and the number
  540.     of bytes added is indicated by the BufferSize field of the ImageDescription.
  541.     
  542.     Return values:
  543.                         noErr
  544.                         codecErr
  545.                         codecAbortErr
  546.                         noCodecErr
  547.                         paramErr
  548.                         memFullErr
  549.  
  550. */
  551.  
  552. pascal OSErr
  553. CompressImage(PixMapHandle src,Rect *srcRect,CodecQ quality,CodecType cType,
  554.         ImageDescriptionHandle desc,Ptr data)
  555.     = {0x7000+0x0006,0xAAA3}
  556. ;
  557.  
  558. pascal OSErr
  559. FCompressImage(PixMapHandle src,Rect *srcRect, short colorDepth,
  560.         CodecQ quality,CodecType cType,CompressorComponent codec,CTabHandle clut,
  561.         CodecFlags flags,long bufferSize,
  562.         FlushProcRecordPtr flushProc,ProgressProcRecordPtr progressProc, ImageDescriptionHandle desc,Ptr data)
  563.     = {0x7000+0x0007,0xAAA3}
  564. ;
  565.  
  566.  
  567.  
  568.  
  569. /*************************
  570.     DecompressImage
  571.     
  572.     This routine decompresses a single image to a pixmap with the given parameters.
  573.     ImageDescription is a pointer to the additional data generated by CompressImage.
  574.     The compressed data should be pointed to by data. 
  575.     
  576.     The dstPixMap, dstRect, mode and mask determine how the image
  577.     will be displayed (similar to copybits).
  578.     
  579.     If matrix is not nil, it is used to position the decompressed image in the destination, 
  580.     this can be used to perform flips, warps or rotations, as well as simple translation and
  581.     scaling.
  582.     
  583.     If matte is not nil then it will be used as a blend matte to blend the image into the
  584.     background of the pixmap as in CopyDeepMask. The matte can be any depth, but should be
  585.     the size of the source image.
  586.     
  587.     Mask is similar to matte, except it is the size of the destination image, and it is a
  588.     standard region.
  589.     
  590.     The port and gdevice should be set to match the destination pixmap, as in CopyBits.
  591.     
  592.     If picSave is true for the current GrafPort, the compressed image will be stored
  593.     in the currently open picture. The matte, mask and matrix are also stored in the
  594.     picture with the compressed picture.
  595.     
  596.     
  597.     Return values:
  598.                         noErr
  599.                         codecErr
  600.                         noCodecErr
  601.                         paramErr
  602.                         memFullErr
  603.  
  604. */
  605.  
  606.  
  607.  
  608. pascal OSErr
  609. DecompressImage(Ptr data,ImageDescriptionHandle desc,PixMapHandle dst,
  610.         Rect *srcRect,Rect *dstRect,short mode,RgnHandle mask)
  611.     = {0x7000+0x0008,0xAAA3}
  612. ;
  613.  
  614.  
  615.  
  616. pascal OSErr
  617. FDecompressImage(Ptr data,ImageDescriptionHandle desc,PixMapHandle dst,Rect *srcRect,
  618.         MatrixRecordPtr matrix,short mode,RgnHandle mask,
  619.         PixMapHandle matte,Rect *matteRect,
  620.         CodecQ accuracy,DecompressorComponent codec,
  621.         long bufferSize,DataProcRecordPtr dataProc,ProgressProcRecordPtr progressProc)
  622.     = {0x7000+0x0009,0xAAA3}
  623. ;
  624.  
  625.  
  626.  
  627. /*************************
  628.  
  629.  
  630.     CompressSequenceBegin
  631.     
  632.     
  633.     This routine begins the compression of a sequence of compressed frames.
  634.  
  635.     ColorDepth tells the codec the pixel depth at which this image will most likely be viewed. 
  636.     Some codecs will use this to determine the color resolution of the compressed image. You
  637.     can determine which depths are supported by GetCodecInfo or GetCodecDepthList. If colorDepth is
  638.     zero the best matching depth available for the compressor is used. If the depth you specify
  639.     is not available the closest possible depth that the compressor can do is used.
  640.  
  641.     If temporalQuality is not zero, then the compressor may use information from the "prev" PixMap to reduce redundancy.  The
  642.     keyFrameRate parameter hints at how often to force a full key frame into the sequence. 
  643.     The key frames may be placed at more frequent intervals if needed - if you must
  644.     have keyframes at a fixed rate or at particular frames, the temporalQuality
  645.     can be changed on a per frame basis as needed ( 0 forces a key frame ). If keyFrameRate 
  646.     is zero, they will never be any key frames. 
  647.     
  648.     
  649.     If the codecFlag codecFlagUpdatePrevious flag is true, and
  650.     temporalQuality is not zero the src PixMap is copied into the prev PixMap by the codec.
  651.     
  652.     If prev is nil and temporalQuality is not zero, then an offscreen
  653.     GWorld will be temporarily allocated and used for the sequence 
  654.     ( this assumes copyframe will be used to keep the prev data up to date.)
  655.  
  656.     
  657.     Return values:
  658.                         noErr
  659.                         codecErr
  660.                         noCodecErr
  661.                         paramErr
  662.                         memFullErr
  663.  
  664. */
  665.  
  666. pascal OSErr
  667. CompressSequenceBegin(ImageSequence *seqID,PixMapHandle src,PixMapHandle prev,
  668.         Rect *srcRect,Rect *prevRect,short colorDepth,CodecType cType,CompressorComponent codec,
  669.         CodecQ spatialQuality,CodecQ temporalQuality,long keyFrameRate,
  670.         CTabHandle clut,CodecFlags flags,ImageDescriptionHandle desc)
  671.     = {0x7000+0x000a,0xAAA3}
  672. ;
  673.  
  674.  
  675.  
  676. /*************************
  677.  
  678.     CompressSequenceFrame
  679.     
  680.     This should be called for subsequent frames with the seqID returned with the
  681.     CompressSequenceFirst call. It acts like the CompressSequenceBegin call with the exception 
  682.     of the similarity parameter, in which ( if it is not nil ) the similarity
  683.     between the previous frame and the current frame is returned. If similarity is
  684.     0 then the frame is a guaranteed key frame, if it is 255 it is identical with the
  685.     previous frame otherwise it ranges from 254 (very similar) to 1 (very different).
  686.     
  687.     Return values:
  688.                         noErr
  689.                         codecErr
  690.                         noCodecErr
  691.                         paramErr
  692.                         memFullErr
  693.                         codecSequenceErr
  694.  
  695. */
  696.  
  697.  
  698. pascal OSErr
  699. CompressSequenceFrame(ImageSequence seqID,PixMapHandle src,Rect *srcRect,
  700.         CodecFlags flags,Ptr data,long *dataSize,
  701.         unsigned char *similarity,CompletionProcRecordPtr asyncCompletionProc)
  702.     = {0x7000+0x000b,0xAAA3}
  703. ;
  704.  
  705.  
  706.  
  707.  
  708. /*************************
  709.  
  710.  
  711.     DecompressSequenceBegin
  712.     
  713.     This routine sets up the codec manager to begin decompressing a sequence of compressed
  714.     images. The sequence must be of all the same compression type.
  715.     
  716.     if the codecFlag codecFlagUseScreenBuffer is true, an offscreen buffer the size of
  717.     the destination is allocated and decompressed data will be written there, and then
  718.     copied to the destination. This can be used to reduce tearing that may happen in some
  719.     cases when decompressing directly to a screen. If the codecFlag
  720.     codecFlagUseImageBuffer is set, then an offscreen buffer the size of the compressed
  721.     data will be created. This would allow updates to work correctly for data that is
  722.     temporally compressed, since a full copy of the frame in progress will always be
  723.     available.
  724.     
  725.     The dstPixMap, dstRect, mode and mask determine how the image will be displayed
  726.     (similar to copybits).
  727.  
  728.     If matrix is not nil, it is used to position the decompressed image in the destination, 
  729.     this can be used to perform flips, warps or rotations.
  730.         
  731.     Return values:
  732.                         noErr
  733.                         codecErr
  734.                         noCodecErr
  735.                         paramErr
  736.                         memFullErr
  737.                         codecSequenceErr
  738.                         codecScreenBufErr
  739.                         codecImageBufErr
  740.     
  741. */
  742.  
  743.  
  744. pascal OSErr
  745. DecompressSequenceBegin(ImageSequence *seqID,ImageDescriptionHandle desc,
  746.         CGrafPtr port,GDHandle gdh,Rect *srcRect,MatrixRecordPtr matrix,
  747.         short mode,RgnHandle mask,CodecFlags flags,CodecQ accuracy,DecompressorComponent codec)
  748.     = {0x7000+0x000d,0xAAA3}
  749. ;
  750.  
  751.  
  752. /*************************
  753.  
  754.     DecompressSequenceFrame
  755.     
  756.     This routine decompresses frames of a sequence to a pixmap with the given parameters.
  757.     The data is taken from the pointer data. LastFrame should be set to true for the last
  758.     frame of the sequence. If asyncCompletionProc is not nil, than the call is performed 
  759.     asynchronously,and will return to the caller immediately, but the data will not be 
  760.     valid until the asyncCompletionProc is called.  If the codecFlag codecFlagNoScreenUpdate is true,
  761.     then only the offscreen image buffer will be updated.
  762.  
  763.     
  764.     Return values:
  765.                         noErr
  766.                         codecErr
  767.                         noCodecErr
  768.                         paramErr
  769.                         memFullErr
  770.                         codecSequenceErr
  771.  
  772. */
  773.  
  774.  
  775. pascal OSErr
  776. DecompressSequenceFrame(ImageSequence seqID,Ptr data,
  777.         CodecFlags inFlags,CodecFlags *outFlags,CompletionProcRecordPtr asyncCompletionProc)
  778.     = {0x7000+0x000e,0xAAA3}
  779. ;
  780.  
  781.  
  782. pascal OSErr
  783. SetDSequenceMatrix(ImageSequence seqID,MatrixRecordPtr matrix)
  784.     = {0x7000+0x0010,0xAAA3}
  785. ;
  786.  
  787. pascal OSErr
  788. SetDSequenceMatte(ImageSequence seqID,PixMapHandle matte,Rect *matteRect)
  789.     = {0x7000+0x0011,0xAAA3}
  790. ;
  791.  
  792. pascal OSErr
  793. SetDSequenceMask(ImageSequence seqID,RgnHandle mask)
  794.     = {0x7000+0x0012,0xAAA3}
  795. ;
  796.  
  797. pascal OSErr
  798. SetDSequenceTransferMode(ImageSequence seqID,short mode,RGBColor *opColor)
  799.     = {0x7000+0x0013,0xAAA3}
  800. ;
  801.  
  802. pascal OSErr
  803. SetDSequenceDataProc(ImageSequence seqID,DataProcRecordPtr dataProc,long bufferSize)
  804.     = {0x7000+0x0014,0xAAA3}
  805. ;
  806.  
  807. pascal OSErr
  808. SetDSequenceAccuracy(ImageSequence seqID,CodecQ accuracy)
  809.     = {0x7000+0x0034,0xAAA3}
  810. ;
  811.  
  812. pascal OSErr
  813. SetDSequenceSrcRect(ImageSequence seqID,Rect *srcRect)
  814.     = {0x7000+0x0035,0xAAA3}
  815. ;
  816.  
  817. pascal OSErr
  818. GetDSequenceImageBuffer(ImageSequence seqID,GWorldPtr *gworld)
  819.     = {0x7000+0x0015,0xAAA3};
  820.  
  821. pascal OSErr
  822. GetDSequenceScreenBuffer(ImageSequence seqID,GWorldPtr *gworld)
  823.     = {0x7000+0x0016,0xAAA3};
  824.  
  825. pascal OSErr
  826. SetCSequenceQuality(ImageSequence seqID,CodecQ spatialQuality,CodecQ temporalQuality)
  827.     = {0x7000+0x0017,0xAAA3}
  828. ;
  829.  
  830. pascal OSErr
  831. SetCSequencePrev(ImageSequence seqID,PixMapHandle prev,Rect *prevRect)
  832.     = {0x7000+0x0018,0xAAA3}
  833. ;
  834.  
  835.  
  836. pascal OSErr
  837. SetCSequenceFlushProc(ImageSequence seqID,FlushProcRecordPtr flushProc,long bufferSize)
  838.     = {0x7000+0x0033,0xAAA3}
  839. ;
  840.  
  841. pascal OSErr
  842. SetCSequenceKeyFrameRate(ImageSequence seqID,long keyframerate)
  843.     = {0x7000+0x0036,0xAAA3}
  844. ;
  845.  
  846.  
  847. pascal OSErr
  848. GetCSequencePrevBuffer(ImageSequence seqID,GWorldPtr *gworld)
  849.     = {0x7000+0x0019,0xAAA3};
  850.  
  851.  
  852. pascal OSErr
  853. CDSequenceBusy(ImageSequence seqID)
  854.     = {0x7000+0x001a,0xAAA3}
  855. ;
  856.  
  857.  
  858.  
  859.  
  860. /*************************
  861.  
  862.  
  863.     SequenceEnd
  864.     
  865.     This call should be made when done with compressing or decompressing a sequence.
  866.     
  867.     Return values:
  868.                         noErr
  869.                         codecErr
  870.                         noCodecErr
  871.                         paramErr
  872.                         memFullErr
  873.                         codecSequenceErr
  874.  
  875. */
  876.  
  877.  
  878. pascal OSErr
  879. CDSequenceEnd(ImageSequence seqID)
  880.     = {0x7000+0x001b,0xAAA3}
  881. ;
  882.  
  883. /*************************
  884.  
  885.  
  886.     GetCompressedImageSize
  887.     
  888.     
  889.     Normally the dataSize field in the ImageDescription indicates the size 
  890.     in bytes of the image data. If the image is from a sequence you may need to
  891.     determine the size from the data alone.
  892.     This routine returns the size of the compressed data for the codec with the 
  893.     given type. It is used for parsing a combined input stream. If type is zero,
  894.     the proper codec will be used.
  895.     
  896.     Return values:
  897.                         noErr
  898.                         codecErr
  899.                         noCodecErr
  900.                         paramErr
  901.  
  902. */
  903.  
  904. pascal OSErr
  905. GetCompressedImageSize(ImageDescriptionHandle desc,Ptr data,long bufferSize,
  906.         DataProcRecordPtr dataProc,long *dataSize)
  907.     = {0x7000+0x001c,0xAAA3}
  908. ;
  909.  
  910.  
  911. /*************************
  912.  
  913.  
  914.     GetSimilarity
  915.     
  916.     This routine returns the similarity of the a compressed image with a pixmap. The value returned
  917.     is between 1 ( very different) and 254 (very similar) and 255 means the two are identical.
  918.     
  919.     Return values:
  920.                         noErr
  921.                         codecErr
  922.                         noCodecErr
  923.                         paramErr
  924.                         memFullErr
  925.  
  926. */
  927.  
  928. pascal OSErr
  929. GetSimilarity(PixMapHandle src,Rect *srcRect,ImageDescriptionHandle desc,Ptr data,Fixed *similarity)
  930.     = {0x7000+0x001d,0xAAA3}
  931. ;
  932.  
  933.  
  934. /*************************
  935.  
  936.  
  937.     GetImageDescriptionCTable
  938.     
  939.     
  940.     This returns the color table stored in the given image descriptor. This is usually called only by 
  941.     Codecs. The color table should be disposed with DisposCTable when your are done with it.
  942.  
  943.     Return values:
  944.                         noErr
  945.                         codecErr
  946.                         noCodecErr
  947.                         paramErr
  948.                         memFullErr
  949.  
  950. */
  951.  
  952. pascal OSErr
  953. GetImageDescriptionCTable(ImageDescriptionHandle desc,CTabHandle *ctable)
  954.     = {0x7000+0x001e,0xAAA3}
  955. ;
  956.  
  957. /*************************
  958.  
  959.  
  960.     SetImageDescriptionCTable
  961.     
  962.     
  963.     This sets the color table stored in the given image descriptor to the given color table.
  964.     This should be called only by Codecs. 
  965.  
  966.     Return values:
  967.                         noErr
  968.                         codecErr
  969.                         noCodecErr
  970.                         paramErr
  971.                         memFullErr
  972.  
  973. */
  974.  
  975. pascal OSErr
  976. SetImageDescriptionCTable(ImageDescriptionHandle desc,CTabHandle ctable)
  977.     = {0x7000+0x001f,0xAAA3}
  978. ;
  979.  
  980.  
  981.  
  982. /*************************
  983.  
  984.  
  985.     GetImageDescriptionExtension
  986.     
  987.     
  988.     This gets the extended data stored in the given image descriptor. This is usually
  989.     done only by Codecs. The extended data is specific to the CodecType which created
  990.     the ImageDescription.
  991.  
  992.     Return values:
  993.                         noErr
  994.                         codecErr
  995.                         noCodecErr
  996.                         paramErr
  997.                         memFullErr
  998.  
  999. */
  1000.  
  1001. pascal OSErr
  1002. GetImageDescriptionExtension(ImageDescriptionHandle desc,Handle *extension,long type,long index)
  1003.     = {0x7000+0x0020,0xAAA3}
  1004. ;
  1005.  
  1006.  
  1007.  
  1008. /*************************
  1009.  
  1010.  
  1011.     SetImageDescriptionExtension
  1012.     
  1013.     
  1014.     This appends extension data to the given image descriptor. This done only by Codecs. 
  1015.     The extended data is specific to the CodecType which created the ImageDescription.
  1016.  
  1017.     Return values:
  1018.                         noErr
  1019.                         codecErr
  1020.                         noCodecErr
  1021.                         paramErr
  1022.                         memFullErr
  1023.  
  1024. */
  1025.  
  1026. pascal OSErr
  1027. SetImageDescriptionExtension(ImageDescriptionHandle desc,Handle extension, long type) 
  1028.     = {0x7000+0x0021,0xAAA3}
  1029. ;
  1030.  
  1031.  
  1032. /*************************
  1033.  
  1034.     FindCodec
  1035.  
  1036.     This routine returns the actual codec used when the special codec identifier ( i.e. bestSpeedCodec) 
  1037.     specCodec.
  1038.     
  1039.     Return values:
  1040.                         noErr
  1041.                         codecErr
  1042.                         noCodecErr
  1043.                         paramErr
  1044.                         memFullErr
  1045.  
  1046. */
  1047.  
  1048.  
  1049.  
  1050.  
  1051. pascal OSErr
  1052. FindCodec(CodecType cType,CodecComponent specCodec,
  1053.         CompressorComponent *compressor,DecompressorComponent *decompressor)
  1054.     = {0x7000+0x0023,0xAAA3}
  1055. ;
  1056.  
  1057.  
  1058.  
  1059.  
  1060.  
  1061.  
  1062. /*************************
  1063.  
  1064.     CompressPicture
  1065.  
  1066.     This routine compresses a picture with the given parameters.
  1067.     Quality determines the quality of the compressed image.
  1068.     
  1069.     
  1070.     Return values:
  1071.                         noErr
  1072.                         codecErr
  1073.                         noCodecErr
  1074.                         paramErr
  1075.                         memFullErr
  1076.  
  1077. */
  1078.  
  1079.  
  1080.  
  1081. pascal OSErr
  1082. CompressPicture(PicHandle srcPicture, PicHandle dstPicture,CodecQ quality,CodecType cType)
  1083.     = {0x7000+0x0024,0xAAA3}
  1084. ;
  1085.  
  1086.  
  1087. /*************************
  1088.  
  1089.     FCompressPicture
  1090.  
  1091.     The fancy version routine compresses a picture with the given parameters.
  1092.     Quality determines the quality of the compressed image.
  1093.     
  1094.     
  1095.     Return values:
  1096.                         noErr
  1097.                         codecErr
  1098.                         noCodecErr
  1099.                         paramErr
  1100.                         memFullErr
  1101.  
  1102. */
  1103.  
  1104. pascal OSErr
  1105. FCompressPicture(PicHandle srcPicture, PicHandle dstPicture,
  1106.         short colorDepth, CTabHandle clut,CodecQ quality,
  1107.         sBoolean doDither,sBoolean compressAgain,ProgressProcRecordPtr progressProc,
  1108.         CodecType cType,CompressorComponent codec)
  1109.     = {0x7000+0x0025,0xAAA3}
  1110. ;
  1111.  
  1112.  
  1113.  
  1114. /*************************
  1115.  
  1116.     CompressPictureFile
  1117.  
  1118.  
  1119.     This is the same as CompressPicture, except the picture is read from the PICT file specified by sRefNum,
  1120.     and written to dRefNum.
  1121.     
  1122.     
  1123.     Return values:
  1124.                         noErr
  1125.                         codecErr
  1126.                         noCodecErr
  1127.                         paramErr
  1128.                         memFullErr
  1129.  
  1130. */
  1131.  
  1132.  
  1133.  
  1134. pascal OSErr
  1135. CompressPictureFile(short srcRefNum, short dstRefNum,CodecQ quality,CodecType cType)
  1136.     = {0x7000+0x0026,0xAAA3}
  1137. ;
  1138.  
  1139. pascal OSErr
  1140. FCompressPictureFile(short srcRefNum, short dstRefNum,short colorDepth, CTabHandle clut,
  1141.     CodecQ quality, sBoolean doDither,sBoolean compressAgain,ProgressProcRecordPtr progressProc,
  1142.     CodecType cType,CompressorComponent codec)
  1143.     = {0x7000+0x0027,0xAAA3}
  1144. ;
  1145.  
  1146.  
  1147.  
  1148.  
  1149.  
  1150. /*************************
  1151.  
  1152.     GetPictureFileHeader
  1153.  
  1154.  
  1155.     This returns the picFrame for the picture is in the PICT file specified by refnum.
  1156.     
  1157.     
  1158.     Return values:
  1159.                         noErr
  1160.                         paramErr
  1161.                         memFullErr
  1162.  
  1163. */
  1164.  
  1165. pascal OSErr
  1166. GetPictureFileHeader(short refNum,Rect *frame,OpenCPicParams *header)
  1167.     = {0x7000+0x0028,0xAAA3}
  1168. ;
  1169.  
  1170.  
  1171.  
  1172. /*************************
  1173.  
  1174.     DrawPictureFile
  1175.  
  1176.  
  1177.     This draws the picture from the given PICT file in the current grafport at the
  1178.     position specified by rect.
  1179.     
  1180.     
  1181.     Return values:
  1182.                         noErr
  1183.                         paramErr
  1184.                         memFullErr
  1185.  
  1186. */
  1187.  
  1188.  
  1189.  
  1190. pascal OSErr
  1191. DrawPictureFile(short refNum,Rect *frame,ProgressProcRecordPtr progressProc)
  1192.     = {0x7000+0x0029,0xAAA3}
  1193. ;
  1194.  
  1195.  
  1196.  
  1197. /*************************
  1198.  
  1199.     DrawTrimmedPicture
  1200.     
  1201.     This removes as much data as possible which does not intersect the given mask region from the srcPicture.
  1202.     The result is drawn to the current port and frame.
  1203.  
  1204. */
  1205.  
  1206.  
  1207. pascal OSErr
  1208. DrawTrimmedPicture(PicHandle srcPicture,Rect *frame,RgnHandle trimMask,sBoolean doDither,
  1209.         ProgressProcRecordPtr progressProc)
  1210.     = {0x7000+0x002e,0xAAA3}
  1211. ;
  1212.  
  1213.  
  1214. /*************************
  1215.  
  1216.     DrawTrimmedPictureFile
  1217.     
  1218.     This removes as much data as possible which does not intersect the given mask region from the PICT file specified
  1219.     by srcRefNum. The result is placed in the PICT file specified by dstRefNum if dstRefNum is not an empty file,
  1220.     whatever data was in it is lost.
  1221.  
  1222. */
  1223.  
  1224.  
  1225. pascal OSErr
  1226. DrawTrimmedPictureFile(short srcRefnum,Rect *frame,RgnHandle trimMask,sBoolean doDither,
  1227.         ProgressProcRecordPtr progressProc)
  1228.     = {0x7000+0x002f,0xAAA3}
  1229. ;
  1230.  
  1231.  
  1232.  
  1233.  
  1234.  
  1235. /*************************
  1236.  
  1237.  
  1238.     MakeThumbnail creates a Thumbnail picture from the given PICT file. The thumbnail is
  1239.     optimized for the given pixel depth. 
  1240.     
  1241.     Depth is 1,2,4,8,16,24,32 for
  1242.     for color, or 33,34,36,40 for 1,2,4, and 8 bit/pixel grayscale. If depth is zero,
  1243.     the best depth for the given pixture is used.
  1244.  
  1245.  
  1246.     Return values:
  1247.                         noErr
  1248.                         codecErr
  1249.                         paramErr
  1250.                         memFullErr
  1251.  
  1252. */
  1253.  
  1254. pascal OSErr
  1255. MakeThumbnailFromPicture(PicHandle picture,short colorDepth,PicHandle thumbnail,
  1256.         ProgressProcRecordPtr progressProc)
  1257.     = {0x7000+0x002a,0xAAA3}
  1258. ;
  1259.  
  1260.  
  1261.  
  1262. /*************************
  1263.  
  1264.     MakeThumbnail creates a Thumbnail picture from the given PICT file. The thumbnail is
  1265.     optimized for the size of the given rect and the given pixel depth.
  1266.     
  1267.     Depth is 1,2,4,8,16,24,32 for
  1268.     for color, or 33,34,36,40 for 1,2,4, and 8 bit/pixel grayscale. If depth is zero,
  1269.     the best depth for the given pixture is used.
  1270.  
  1271.     Return values:
  1272.                         noErr
  1273.                         codecErr
  1274.                         paramErr
  1275.                         memFullErr
  1276.  
  1277. */
  1278.  
  1279. pascal OSErr
  1280. MakeThumbnailFromPictureFile(short refNum,short colorDepth,PicHandle thumbnail,
  1281.         ProgressProcRecordPtr progressProc)
  1282. = {0x7000+0x002b,0xAAA3}
  1283. ;
  1284.  
  1285. /*************************
  1286.  
  1287.     MakeThumbnail creates a Thumbnail picture from the given pixmap. The thumbnail is
  1288.     optimized for the given pixel depth. Depth is 1,2,4,8,16,24,32 for
  1289.     for color, or 33,34,36,40 for 1,2,4, and 8 bit/pixel grayscale. If depth is zero,
  1290.     the best depth for the given pixture is used.
  1291.  
  1292.     Return values:
  1293.                         noErr
  1294.                         codecErr
  1295.                         paramErr
  1296.                         memFullErr
  1297.  
  1298. */
  1299.  
  1300. pascal OSErr
  1301. MakeThumbnailFromPixMap(PixMapHandle src,Rect *srcRect,short colorDepth,PicHandle thumbnail,
  1302.         ProgressProcRecordPtr progressProc)
  1303. = {0x7000+0x002c,0xAAA3}
  1304. ;
  1305.  
  1306.  
  1307.  
  1308.  
  1309.  
  1310. /*************************
  1311.  
  1312.     TrimImage
  1313.     
  1314.     This removes as much data as possible which does not intersect the given mask region from the compressed image .
  1315.     The trimMask is aligned with the entire original image.
  1316.  
  1317. */
  1318.  
  1319.  
  1320. pascal OSErr
  1321. TrimImage(ImageDescriptionHandle desc,Ptr inData,long inBufferSize,DataProcRecordPtr dataProc,
  1322.         Ptr    outData,long outBufferSize,FlushProcRecordPtr flushProc,Rect *trimRect,
  1323.         ProgressProcRecordPtr progressProc)
  1324.     = {0x7000+0x002d,0xAAA3}
  1325. ;
  1326.  
  1327.  
  1328.  
  1329. /*************************
  1330.  
  1331.     ConvertImage
  1332.     
  1333.     This routine converts compressed data from one format to another format or within
  1334.     the same format with new parameters.
  1335.     
  1336.     
  1337.     ColorDepth tells the codec the pixel depth at which this image will most likely be viewed. 
  1338.     Some codecs will use this to determine the color resolution of the compressed image. You
  1339.     can determine which depths are supported by GetCodecInfo or GetCodecDepthList. If colorDepth is
  1340.     zero the best matching depth available for the compressor is used. If the depth you specify
  1341.     is not available the closest possible depth that the compressor can do is used.
  1342.         
  1343.     DstRect determines the size of the resulting image - if it is nil, the original image
  1344.     size will be used.
  1345.  
  1346.     The data is taken from the pointer srcData, and is converted and placed into the 
  1347.     Ptr dstData, which should be the size of the worst case converted data  see GetCompressionSize).
  1348.     Quality, type and id define the compression parameters for the new data.
  1349.     
  1350.     The dstPixMap, dstRect, mode and mask determine how the image will be displayed
  1351.     (similar to copybits).
  1352.     
  1353.     If matrix is not nil, it is used to position the decompressed image in the destination, 
  1354.     this can be used to perform flips, warps or rotations.
  1355.     
  1356.     
  1357.     Return values:
  1358.                         noErr
  1359.                         codecErr
  1360.                         noCodecErr
  1361.                         paramErr
  1362.                         memFullErr
  1363.  
  1364. */
  1365.  
  1366. pascal OSErr
  1367. ConvertImage(ImageDescriptionHandle srcDD,Ptr srcData,short colorDepth,CTabHandle clut,
  1368.         CodecQ accuracy,CodecQ quality,CodecType cType,CodecComponent codec,
  1369.         ImageDescriptionHandle dstDD,Ptr dstData)
  1370.     = {0x7000+0x0030,0xAAA3}
  1371. ;
  1372.  
  1373.  
  1374.  
  1375. /*************************
  1376.  
  1377.  
  1378.     MakeDitherTable creates a dither table for doing fast dithering from using the given
  1379.     gdevice.
  1380.     
  1381.     
  1382.     
  1383.         return results:
  1384.         
  1385.                 noErr
  1386.                 memFullErr
  1387.                 paramErr
  1388. */
  1389.  
  1390.  
  1391. pascal OSErr
  1392. MakeDitherTable(GDHandle gdev,DTabHPtr *ditherTable)
  1393.     = {0x7000+0x0031,0xAAA3}
  1394. ;
  1395.  
  1396.  
  1397. /*************************
  1398.  
  1399.  
  1400.     DisposeDitherTable disposes a dither table made by MakeDitherTable.
  1401.     
  1402.                 noErr
  1403.                 paramErr
  1404. */
  1405.  
  1406.  
  1407. pascal OSErr
  1408. DisposeDitherTable(DTabHPtr ditherTable)
  1409.     = {0x7000+0x0032,0xAAA3}
  1410. ;
  1411.  
  1412.  
  1413. /*************************
  1414.  
  1415.  
  1416.     GetCompressedPixMapInfo extracts the compressed image info packed into a pixmap when passed
  1417.     to StdPix.
  1418.     
  1419.                 noErr
  1420.                 paramErr
  1421. */
  1422.  
  1423.  
  1424.  
  1425. pascal OSErr
  1426. GetCompressedPixMapInfo(PixMapPtr pix,ImageDescriptionHandle *desc,Ptr *data,long *bufferSize,
  1427.     DataProcRecord *dataProc,ProgressProcRecord *progressProc)
  1428.     = {0x7000+0x0037,0xAAA3}
  1429. ;
  1430.  
  1431. /*************************
  1432.  
  1433.  
  1434.     SetCompressedPixMapInfo encodes the compressed image info packed into a pixmap for use when
  1435.     passed to StdPix.
  1436.     
  1437.                 noErr
  1438.                 paramErr
  1439. */
  1440.  
  1441.  
  1442.  
  1443. pascal OSErr
  1444. SetCompressedPixMapInfo(PixMapPtr pix,ImageDescriptionHandle desc,Ptr data,long bufferSize,
  1445.     DataProcRecordPtr dataProc,ProgressProcRecordPtr progressProc)
  1446.     = {0x7000+0x0038,0xAAA3}
  1447. ;
  1448.  
  1449.  
  1450. /*************************
  1451.  
  1452.  
  1453.     TransformRgn encodes the compressed image info packed into a pixmap for use when
  1454.     passed to StdPix.
  1455.     
  1456.                 noErr
  1457.                 (results of QDError)
  1458. */
  1459.  
  1460. pascal OSErr
  1461. TransformRgn(MatrixRecord *matrix, RgnHandle rgn)
  1462.     = {0x7000+0x0039,0xAAA3}
  1463. ;
  1464.  
  1465.  
  1466.  
  1467. #endif    __CODEC__
  1468.